package com.yd.location.module.cms.domain;

import com.baomidou.mybatisplus.annotation.TableName;
import com.yd.location.common.enumeration.EnumInterface;
import com.yd.location.common.spring.mpbase.MyEntity;
import com.yd.location.common.validation.annotation.NotBlank;
import com.yd.location.common.validation.annotation.NotNull;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * @author Created by zk on 2020-07-14 19:46
 * @description 我的-动态广告
 */
@Data
@Entity
@EqualsAndHashCode(callSuper = true)
@TableName("cms_advert")
@Table(name = "cms_advert")
public class Advert extends MyEntity {

    @Getter
    @AllArgsConstructor
    public enum AdvertType implements EnumInterface {
        LINK(1, "链接"),
        RICH_TEXT(2, "富文本"),;
        private Integer code;
        private String status;
    }

    @NotBlank(message = "请填写标题")
    private String name = "";

    @NotNull(message = "请填写排序值")
    private Integer sortValue = 0;//排序值，正序排列，数值越小越靠前，支持负数

    @NotNull(message = "请选择广告类型")
    private Integer type = 1;

    private String link = "";

    @Column(length = 5000)
    private String content = "";
}
